#ifndef _AQ_HASHTABLE_H
#define _AQ_HASHTABLE_H


typedef struct {
	void*	pKey;
	void* 	pData;
	size_t	nSize;
} AQ_HashElement;

typedef struct {
	unsigned long ulKey;
};

class AQ_HashTable {
	enum {
		HASH_BUCKET_NUMS = 5;
	};

public:
	AQ_HashTable();
	virtual ~AQ_HashTable();

public:
	int Add(AQ_HashElement* pHE);
	int Del(AQ_HashElement* pHE);
	int Update(AQ_HashElement* pNewHE);
	AQ_HashElement* Get(void* k) const;
	int Count() const;

public:
	void SetHashBucketNums(int iNums);

private:
	bool	IsPrimeNum(int N);

private:
//	bool (* _EqualFunc)(void* k1, void* k2);
//	unsigned long (* _HashFunc)(void* k);
//	void (* _Print)(AQ_HashElement*);

	int		m_iCount;	
	int 	m_iHashBucketLen;	
	int 	m_iHashBucketNums;
	AQ_HashElement** m_HT;
};


#endif

